package com.godpaper.twoHitOne.util
{
	public class NumberUtil
	{
		public static function randomNumberWithScope(minNum:Number, maxNum:Number, round:Boolean = true):int
		{
			if(minNum < 0) {
				var posMin:int = (minNum*-1);
				var range:int = posMin+maxNum;
				if(round) { return Math.floor(Math.random() * (range - 1))-posMin; }
				else { return Math.random() * (range - 1)-posMin; }
			} else {
				if(round) { return Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum; }
				else { return Math.random() * (maxNum - minNum + 1) + minNum; }
			}
			return 0;
		}
	}
}